package legumes.client.services.callbacks;

import legumes.client.services.LegumesServicesHelper;
import legumes.client.services.util.rpc.SequencableRPCCall;
import legumes.shared.domain.NewProductMarket;

public class ValidateNewProductMarketCallback extends SequencableRPCCall<Boolean> {

	private NewProductMarket newProductMarket;
	Boolean result;
	
	public ValidateNewProductMarketCallback(NewProductMarket newProductMarket_) {
		newProductMarket = newProductMarket_;
	}

	@Override
	protected void doCall() {
		LegumesServicesHelper.LEGUMES_SERVICES.validateNewProductMarket(newProductMarket, this);
	}

	@Override
	public void onSuccess(Boolean result_) {
		result = result_;
		callNext();
	}

	public Boolean isNewProductMarketAdded() {
		return result;
	}

}
